<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="App">
        <button @click="zeng" :disabled="a <= 1">点击</button>
        <h1>{{a}}</h1>
        <button @click="jian" :disabled="a >= 10">点击</button>
    </div>
</body>
<script src="./vue.js"></script>
<script>
      const {createApp,ref} = Vue;
createApp({
    setup(){
        let a = ref(1);
        const zeng = () => {  
            if (a.value > 1) {  
                a.value--;  
            }  
        };  
        const jian = () => {  
            if (a.value < 10) {  
                a.value++;  
            }  
        };  
        return{
            a,
            zeng,
            jian
    }
    }
   
}).mount('#App')
</script>
</html>